bitkeeper revision 1.1098.1.6 (4107db75itLJdhymWtZH0cAEBEY1jA)
authorsos22@donkeykong.cl.cam.ac.uk <sos22@donkeykong.cl.cam.ac.uk>
Wed, 28 Jul 2004 16:59:33 +0000 (16:59 +0000)
committersos22@donkeykong.cl.cam.ac.uk <sos22@donkeykong.cl.cam.ac.uk>
Wed, 28 Jul 2004 16:59:33 +0000 (16:59 +0000)
Disable interrupts while we're doing debug stuff, to avoid
things changing underneath the user.

xen/arch/x86/xdb.c

index 8c3b49c4d9e3ffb1a57ea462a2176e8f9ecf06c1..fb95750219c8de85f95f8467d2e74f679a930793 100644 (file)
@@ -318,6 +318,7 @@ __trap_to_xendbg(struct pt_regs *regs)
        int r;
        static int xendbg_running;
        static char recv_buf[4096];
+       unsigned flags;
 
        if (xendbg_serhnd < 0) {
                dbg_printk("Debugger not ready yet.\n");
@@ -337,6 +338,10 @@ __trap_to_xendbg(struct pt_regs *regs)
           obvious reason, which is Bad */
        printk("Waiting for GDB to attach to XenDBG\n");
 
+       /* Try to make things a little more stable by disabling
+          interrupts while we're here. */
+       local_irq_save(flags);
+
        while (resume == 0) {
                r = receive_command(recv_buf);
                if (r < 0) {
@@ -346,6 +351,7 @@ __trap_to_xendbg(struct pt_regs *regs)
                        resume = process_command(recv_buf, regs);
        }
        xendbg_running = 0;
+       local_irq_restore(flags);
 }
 
 void